#include"common.hpp"

int main()
{
  int fd = open(str.c_str(),m);   
  if(fd < 0)
  {
    cout << "open file fail " << errno << " " << strerror(errno) << endl;
    return -1;
  }
  char buffer[1024];
  int cnt = 1;
  while(cnt <= 100)
  {
    cout << "我是客户端，我正在向服务端发送信息" << endl;
    snprintf(buffer,sizeof(buffer),"这是我向服务端发送的第%d条信息",cnt++);
    write(fd,buffer,strlen(buffer));
    sleep(2);
  }
  close(fd);
  return 0;
}


